current version 1.9 - 30th April 2025
| Version | Date | Comment |
|---|---|---|
| 0.1 | 29/Jun/2009 | Original code. giovanni ravazzani |
| 0.2 | 09/Aug/2009 | Added GridByIni |
| 0.3 | 07/Apr/2010 | Added GridResample |
| 0.4 | 16/Oct/2010 | function to compute cell area and distance |
| 0.5 | 03/Feb/2011 | Distance moved to GeoLib |
| 0.6 | 01/Aug/2011 | optional argument for cellsize output from GridConvert |
| 0.7 | 19/Oct/2011 | added getSum routines |
| 0.8 | 03/Dec/2012 | GetMin function |
| 0.9 | 20/Mar/2013 | correct a bug in SUBROUTINE ResampleFloat |
| 1.0 | 09/Apr/2013 | MinMaxNormalization and GetMax routines |
| 1.1 | 11/Apr/2013 | ZscoreNormalization and GetStDev routines |
| 1.2 | 12/Mar/2016 | GetRMSE function to compute Root Mean Square Error between two grids real |
| 1.3 | 10/May/2016 | GetBias function to compute Bias between two grids real |
| 1.4 | 19/Dec/2016 | statistic routines moved to new module GridStatistics |
| 1.5 | 28/Nov/2017 | GridByIni modified to read epsg code |
| 1.6 | 03/Mar/2018 | Added functions CellIsNoData and CellIsValid |
| 1.7 | 28/Jan/2020 | Grid2vector subroutine to transform grid content to an array 1D |
| 1.8 | 19/Jan/2021 | Added CellLength, moved ExtractBorder from function to subroutine |
| 1.9 | 30/Apr/2025 | New function IsPointInside to check if a point is inside a raster |
license: GNU GPL http://www.gnu.org/licenses/
This file is part of
MOSAICO -- MOdular library for raSter bAsed hydrologIcal appliCatiOn.
Copyright (C) 2011 Giovanni Ravazzani
library to operate on grids
Description: Description compute area ([m2) of grid excluding nodata
assign value of mask real to mat real
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(grid_real), | intent(inout) | :: | mat | |||
| type(grid_real), | intent(in) | :: | mask |
assign value of mask integer to mat integer
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(grid_integer), | intent(inout) | :: | mat | |||
| type(grid_integer), | intent(in) | :: | mask |
assign value to mat
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(grid_real), | intent(inout) | :: | mat | |||
| real(kind=float), | intent(in) | :: | num |
assign value to mat
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(grid_integer), | intent(inout) | :: | mat | |||
| integer, | intent(in) | :: | num |
assign value of mask real to mat integer. real numbers are truncated to integer part.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(grid_integer), | intent(inout) | :: | mat | |||
| type(grid_real), | intent(in) | :: | mask |
assign value of mask integer to mat real
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(grid_real), | intent(inout) | :: | mat | |||
| type(grid_integer), | intent(in) | :: | mask |
return .TRUE. if the two grids have the same Coordinate Reference System,
and the same spatial reference (cellsize, xllxorner, yllcorner, idim, jdim)
If checkCells is given the function checks that grid has
the same active cells of mask.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(grid_integer), | intent(in) | :: | mask | |||
| type(grid_integer), | intent(in) | :: | grid | |||
| logical, | intent(in), | optional | :: | checkCells |
return .TRUE. if the two grids have the same Coordinate Reference System,
and the same spatial reference (cellsize, xllxorner, yllcorner, idim, jdim)
If checkCells is given the function checks that grid has
the same active cells of mask.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(grid_real), | intent(in) | :: | mask | |||
| type(grid_real), | intent(in) | :: | grid | |||
| logical, | intent(in), | optional | :: | checkCells |
return .TRUE. if the two grids have the same Coordinate Reference System,
and the same spatial reference (cellsize, xllxorner, yllcorner, idim, jdim)
If checkCells is given the function checks that grid has
the same active cells of mask.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(grid_real), | intent(in) | :: | mask | |||
| type(grid_integer), | intent(in) | :: | grid | |||
| logical, | intent(in), | optional | :: | checkCells |
return .TRUE. if the two grids have the same Coordinate Reference System,
and the same spatial reference (cellsize, xllxorner, yllcorner, idim, jdim)
If checkCells is given the function checks that grid has
the same active cells of mask.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(grid_integer), | intent(in) | :: | mask | |||
| type(grid_real), | intent(in) | :: | grid | |||
| logical, | intent(in), | optional | :: | checkCells |
Description compute area (m2) of a cell of a grid as a function of latitude defined by the position of cell in local coordinate system (row, column). Input grid of type grid_real
Reference:
Sivakholundu, K. M., Prabaharan, N. (1998). A program to compute the area of an irregular polygon on a spheroidal surface, Computers & Geosciences, 24(8), 823-826.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(grid_real), | intent(in) | :: | gridIn | |||
| integer, | intent(in) | :: | i |
row and column of cell |
||
| integer, | intent(in) | :: | j |
row and column of cell |
Description compute area (m2) of a cell of a grid as a function of latitude defined by the position of cell in local coordinate system (row, column). Input grid of type grid_integer
Reference:
Sivakholundu, K. M., Prabaharan, N. (1998). A program to compute the area of an irregular polygon on a spheroidal surface, Computers & Geosciences, 24(8), 823-826.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(grid_integer), | intent(in) | :: | gridIn | |||
| integer, | intent(in) | :: | i |
row and column of cell |
||
| integer, | intent(in) | :: | j |
row and column of cell |
returns true if cell of grid_integer contains no data value
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| integer, | intent(in) | :: | i | |||
| integer, | intent(in) | :: | j | |||
| type(grid_integer), | intent(in) | :: | grid |
return true if cell of grid_real contains no data value
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| integer, | intent(in) | :: | i | |||
| integer, | intent(in) | :: | j | |||
| type(grid_real), | intent(in) | :: | grid |
return false if cell is out of grid either contains nodata value,
true otherwise.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| integer, | intent(in) | :: | i | |||
| integer, | intent(in) | :: | j | |||
| type(grid_integer), | intent(in) | :: | grid |
return false if cell is out of grid either contains nodata value,
true otherwise.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| integer, | intent(in) | :: | i | |||
| integer, | intent(in) | :: | j | |||
| type(grid_real), | intent(in) | :: | grid |
Description compute average length (m) of a cell of a grid as the squareroot of area Input grid of type grid_real
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(grid_real), | intent(in) | :: | gridIn | |||
| integer, | intent(in) | :: | i |
row and column of cell |
||
| integer, | intent(in) | :: | j |
row and column of cell |
Description compute average length (m) of a cell of a grid as the squareroot of area Input grid of type grid_integer
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(grid_integer), | intent(in) | :: | gridIn | |||
| integer, | intent(in) | :: | i |
row and column of cell |
||
| integer, | intent(in) | :: | j |
row and column of cell |
Extracts only the cells on the external border. Other cells are
assigned nodata. Border cell is the one that has at least a
nodata value in the neighbouring 8 cells.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(grid_real), | intent(in) | :: | grid | |||
| type(grid_real) | :: | border | ||||
| logical, | intent(in), | optional | :: | cardinal |
Extracts only the cells on the external border. Other cells are
assigned nodata. Border cell is the one that has at least a
nodata value in the neighbouring 8 cells. If cardinal is passed
the routine checks only the four cells in the cardinal direction.
This option is used to obtain border without duplicates. Default is
check all the cells.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(grid_integer), | intent(in) | :: | grid | |||
| type(grid_integer), | intent(out) | :: | border | |||
| logical, | intent(in), | optional | :: | cardinal |
Description compute area (m2) of grid excluding nodata
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(grid_real), | intent(in) | :: | grid |
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(grid_integer), | intent(in) | :: | grid |
returns X and Y coordinate given i and j position in grid(i,j)
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| real(kind=float), | intent(in) | :: | X | |||
| real(kind=float), | intent(in) | :: | Y | |||
| type(grid_real), | intent(in) | :: | grid | |||
| integer, | intent(out) | :: | i | |||
| integer, | intent(out) | :: | j | |||
| logical, | intent(out), | optional | :: | check |
return false if i and j are outside grid definition |
returns X and Y coordinate given i and j position in grid(i,j)
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| real(kind=float), | intent(in) | :: | X | |||
| real(kind=float), | intent(in) | :: | Y | |||
| type(grid_integer), | intent(in) | :: | grid | |||
| integer, | intent(out) | :: | i | |||
| integer, | intent(out) | :: | j | |||
| logical, | intent(out), | optional | :: | check |
return false if i and j are outside grid definition |
returns X and Y coordinate given i and j position in grid(i,j)
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| integer, | intent(in) | :: | i | |||
| integer, | intent(in) | :: | j | |||
| type(grid_real), | intent(in) | :: | grid | |||
| real(kind=float), | intent(out) | :: | X | |||
| real(kind=float), | intent(out) | :: | Y | |||
| logical, | intent(out), | optional | :: | check |
return false if i and j are outside grid definition |
returns X and Y coordinate given i and j position in grid(i,j)
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| integer, | intent(in) | :: | i | |||
| integer, | intent(in) | :: | j | |||
| type(grid_integer), | intent(in) | :: | grid | |||
| real(kind=float), | intent(out) | :: | X | |||
| real(kind=float), | intent(out) | :: | Y | |||
| logical, | intent(out), | optional | :: | check |
return false if i and j are outside grid definition |
return an array 1D of numbers different than nodata in a grid_integer
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(grid_integer), | intent(in) | :: | grid | |||
| integer(kind=short), | intent(out), | ALLOCATABLE | :: | vector(:) |
return an array 1D of numbers different than nodata in a grid_real
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(grid_real), | intent(in) | :: | grid | |||
| real(kind=float), | intent(out), | ALLOCATABLE | :: | vector(:) |
read a grid_real using information stored in ini configuration file
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(IniList), | intent(in) | :: | ini | |||
| type(grid_real), | intent(out) | :: | grid | |||
| character(len=*), | intent(in) | :: | section | |||
| type(DateTime), | intent(in), | optional | :: | time |
read a grid_integer using information stored in ini configuration file
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(IniList), | intent(in) | :: | ini | |||
| type(grid_integer), | intent(out) | :: | grid | |||
| character(len=*), | intent(in) | :: | section |
read a grid_real using information stored in ini configuration file
defined in subsection [[...]]
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(IniList), | intent(in) | :: | ini | |||
| type(grid_real), | intent(out) | :: | grid | |||
| character(len=*), | intent(in) | :: | section | |||
| character(len=*), | intent(in) | :: | subsection |
read a grid_integer using information stored in ini configuration file
defined in subsection [[.. ]]
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(IniList), | intent(in) | :: | ini | |||
| type(grid_integer), | intent(out) | :: | grid | |||
| character(len=*), | intent(in) | :: | section | |||
| character(len=*), | intent(in) | :: | subsection |
coordinate conversion of a grid_real
definition of corner points:
A---------B
| |
| |
| |
C---------D
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(grid_real), | intent(in) | :: | GridIn | |||
| type(grid_real), | intent(inout) | :: | GridOut | |||
| real(kind=float), | intent(in), | optional | :: | cellsize |
coordinate conversion of a grid_integer
definition of corner points:
A---------B
| |
| |
| |
C---------D
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(grid_integer), | intent(in) | :: | GridIn | |||
| type(grid_integer), | intent(inout) | :: | GridOut | |||
| real(kind=float), | intent(in), | optional | :: | cellsize |
Create a new grid_real with cellsize different from input grid
The content of the created grid is filled in with nearest neighbor method
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(grid_real), | intent(in) | :: | grid | |||
| type(grid_real), | intent(out) | :: | resampledGrid | |||
| real(kind=float), | intent(in) | :: | newCellsize |
Create a new grid_integer with cellsize different from input grid
The content of the created grid is filled in with nearest neighbor method
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(grid_integer), | intent(in) | :: | grid | |||
| type(grid_integer), | intent(out) | :: | resampledGrid | |||
| real(kind=float), | intent(in) | :: | newCellsize |
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(grid_real), | intent(in) | :: | grid | |||
| type(grid_real), | intent(inout) | :: | resampledGrid |
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(grid_integer), | intent(in) | :: | grid | |||
| type(grid_integer), | intent(inout) | :: | resampledGrid |
Apply a shift togrid_integer. Creates a new grid with xllcorner
and yllcorner modified
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(grid_integer), | intent(in) | :: | gridin | |||
| type(grid_integer), | intent(out) | :: | gridout | |||
| real(kind=float), | intent(in) | :: | shifteast |
amount of shift in east direction |
||
| real(kind=float), | intent(in) | :: | shiftnorth |
amount of shift in north direction |
Apply a shift to grid_real. Modifies xllcorner and yllcorner
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(grid_real), | intent(in) | :: | gridin | |||
| type(grid_real), | intent(out) | :: | gridout | |||
| real(kind=float), | intent(in) | :: | shifteast |
amount of shift in east direction |
||
| real(kind=float), | intent(in) | :: | shiftnorth |
amount of shift in north direction |
calculates if cell is out of grid space limits
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| integer, | intent(in) | :: | i | |||
| integer, | intent(in) | :: | j | |||
| type(grid_real), | intent(in) | :: | grid |
calculates if cell is out of grid space limits
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| integer, | intent(in) | :: | i | |||
| integer, | intent(in) | :: | j | |||
| type(grid_integer), | intent(in) | :: | grid |
check if a point is inside a raster cell with value different from nodata
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(Coordinate), | intent(in) | :: | point | |||
| type(grid_real), | intent(in) | :: | grid | |||
| logical, | intent(in) | :: | checkCRS |
check if a point is inside a raster cell with value different from nodata
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(Coordinate), | intent(in) | :: | point | |||
| type(grid_integer), | intent(in) | :: | grid | |||
| logical, | intent(in) | :: | checkCRS |
check if a point is inside a raster cell with value different from nodata
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(Coordinate), | intent(in) | :: | point | |||
| type(grid_real), | intent(in) | :: | grid | |||
| logical, | intent(in) | :: | checkCRS |
check if a point is inside a raster cell with value different from nodata
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(Coordinate), | intent(in) | :: | point | |||
| type(grid_integer), | intent(in) | :: | grid | |||
| logical, | intent(in) | :: | checkCRS |
return .TRUE. if the two grids have the same Coordinate Reference System,
and the same spatial reference (cellsize, xllxorner, yllcorner, idim, jdim)
If checkCells is given the function checks that grid has
the same active cells of mask.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(grid_real), | intent(in) | :: | mask | |||
| type(grid_real), | intent(in) | :: | grid | |||
| logical, | intent(in), | optional | :: | checkCells |
return .TRUE. if the two grids have the same Coordinate Reference System,
and the same spatial reference (cellsize, xllxorner, yllcorner, idim, jdim)
If checkCells is given the function checks that grid has
the same active cells of mask.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(grid_real), | intent(in) | :: | mask | |||
| type(grid_integer), | intent(in) | :: | grid | |||
| logical, | intent(in), | optional | :: | checkCells |
return .TRUE. if the two grids have the same Coordinate Reference System,
and the same spatial reference (cellsize, xllxorner, yllcorner, idim, jdim)
If checkCells is given the function checks that grid has
the same active cells of mask.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(grid_integer), | intent(in) | :: | mask | |||
| type(grid_real), | intent(in) | :: | grid | |||
| logical, | intent(in), | optional | :: | checkCells |
return .TRUE. if the two grids have the same Coordinate Reference System,
and the same spatial reference (cellsize, xllxorner, yllcorner, idim, jdim)
If checkCells is given the function checks that grid has
the same active cells of mask.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(grid_integer), | intent(in) | :: | mask | |||
| type(grid_integer), | intent(in) | :: | grid | |||
| logical, | intent(in), | optional | :: | checkCells |
Description compute area (m2) of a cell of a grid as a function of latitude defined by the position of cell in local coordinate system (row, column). Input grid of type grid_real
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(grid_real), | intent(in) | :: | gridIn | |||
| integer, | intent(in) | :: | i |
row and column of cell |
||
| integer, | intent(in) | :: | j |
row and column of cell |
Description compute area (m2) of a cell of a grid as a function of latitude defined by the position of cell in local coordinate system (row, column). Input grid of type grid_integer
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(grid_integer), | intent(in) | :: | gridIn | |||
| integer, | intent(in) | :: | i |
row and column of cell |
||
| integer, | intent(in) | :: | j |
row and column of cell |
return true if cell of grid_real contains no data value
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| integer, | intent(in) | :: | i | |||
| integer, | intent(in) | :: | j | |||
| type(grid_real), | intent(in) | :: | grid |
returns true if cell of grid_integer contains no data value
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| integer, | intent(in) | :: | i | |||
| integer, | intent(in) | :: | j | |||
| type(grid_integer), | intent(in) | :: | grid |
return false if cell is out of grid either contains nodata value,
true otherwise.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| integer, | intent(in) | :: | i | |||
| integer, | intent(in) | :: | j | |||
| type(grid_real), | intent(in) | :: | grid |
return false if cell is out of grid either contains nodata value,
true otherwise.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| integer, | intent(in) | :: | i | |||
| integer, | intent(in) | :: | j | |||
| type(grid_integer), | intent(in) | :: | grid |
Description compute average length (m) of a cell of a grid as the squareroot of area Input grid of type grid_real
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(grid_real), | intent(in) | :: | gridIn | |||
| integer, | intent(in) | :: | i |
row and column of cell |
||
| integer, | intent(in) | :: | j |
row and column of cell |
Description compute average length (m) of a cell of a grid as the squareroot of area Input grid of type grid_integer
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(grid_integer), | intent(in) | :: | gridIn | |||
| integer, | intent(in) | :: | i |
row and column of cell |
||
| integer, | intent(in) | :: | j |
row and column of cell |
Description compute area (m2) of grid excluding nodata
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(grid_real), | intent(in) | :: | grid |
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(grid_integer), | intent(in) | :: | grid |
calculates if cell is out of grid space limits
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| integer, | intent(in) | :: | i | |||
| integer, | intent(in) | :: | j | |||
| type(grid_real), | intent(in) | :: | grid |
calculates if cell is out of grid space limits
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| integer, | intent(in) | :: | i | |||
| integer, | intent(in) | :: | j | |||
| type(grid_integer), | intent(in) | :: | grid |
return an array 1D of numbers different than nodata in a grid_real
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(grid_real), | intent(in) | :: | grid | |||
| real(kind=float), | intent(out), | ALLOCATABLE | :: | vector(:) |
return an array 1D of numbers different than nodata in a grid_integer
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(grid_integer), | intent(in) | :: | grid | |||
| integer(kind=short), | intent(out), | ALLOCATABLE | :: | vector(:) |
read a grid_integer using information stored in ini configuration file
defined in subsection [[.. ]]
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(IniList), | intent(in) | :: | ini | |||
| type(grid_integer), | intent(out) | :: | grid | |||
| character(len=*), | intent(in) | :: | section | |||
| character(len=*), | intent(in) | :: | subsection |
Apply a shift togrid_integer. Creates a new grid with xllcorner
and yllcorner modified
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(grid_integer), | intent(in) | :: | gridin | |||
| type(grid_integer), | intent(out) | :: | gridout | |||
| real(kind=float), | intent(in) | :: | shifteast |
amount of shift in east direction |
||
| real(kind=float), | intent(in) | :: | shiftnorth |
amount of shift in north direction |
Apply a shift to grid_real. Modifies xllcorner and yllcorner
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(grid_real), | intent(in) | :: | gridin | |||
| type(grid_real), | intent(out) | :: | gridout | |||
| real(kind=float), | intent(in) | :: | shifteast |
amount of shift in east direction |
||
| real(kind=float), | intent(in) | :: | shiftnorth |
amount of shift in north direction |
assign value of mask integer to mat integer
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(grid_integer), | intent(inout) | :: | mat | |||
| type(grid_integer), | intent(in) | :: | mask |
assign value of mask integer to mat real
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(grid_real), | intent(inout) | :: | mat | |||
| type(grid_integer), | intent(in) | :: | mask |
assign value of mask real to mat integer. real numbers are truncated to integer part.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(grid_integer), | intent(inout) | :: | mat | |||
| type(grid_real), | intent(in) | :: | mask |
assign value to mat
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(grid_integer), | intent(inout) | :: | mat | |||
| integer, | intent(in) | :: | num |
assign value to mat
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(grid_real), | intent(inout) | :: | mat | |||
| real(kind=float), | intent(in) | :: | num |
Extracts only the cells on the external border. Other cells are
assigned nodata. Border cell is the one that has at least a
nodata value in the neighbouring 8 cells.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(grid_real), | intent(in) | :: | grid | |||
| type(grid_real) | :: | border | ||||
| logical, | intent(in), | optional | :: | cardinal |
Extracts only the cells on the external border. Other cells are
assigned nodata. Border cell is the one that has at least a
nodata value in the neighbouring 8 cells. If cardinal is passed
the routine checks only the four cells in the cardinal direction.
This option is used to obtain border without duplicates. Default is
check all the cells.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(grid_integer), | intent(in) | :: | grid | |||
| type(grid_integer), | intent(out) | :: | border | |||
| logical, | intent(in), | optional | :: | cardinal |
returns X and Y coordinate given i and j position in grid(i,j)
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| real(kind=float), | intent(in) | :: | X | |||
| real(kind=float), | intent(in) | :: | Y | |||
| type(grid_real), | intent(in) | :: | grid | |||
| integer, | intent(out) | :: | i | |||
| integer, | intent(out) | :: | j | |||
| logical, | intent(out), | optional | :: | check |
return false if i and j are outside grid definition |
returns X and Y coordinate given i and j position in grid(i,j)
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| real(kind=float), | intent(in) | :: | X | |||
| real(kind=float), | intent(in) | :: | Y | |||
| type(grid_integer), | intent(in) | :: | grid | |||
| integer, | intent(out) | :: | i | |||
| integer, | intent(out) | :: | j | |||
| logical, | intent(out), | optional | :: | check |
return false if i and j are outside grid definition |
returns X and Y coordinate given i and j position in grid(i,j)
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| integer, | intent(in) | :: | i | |||
| integer, | intent(in) | :: | j | |||
| type(grid_real), | intent(in) | :: | grid | |||
| real(kind=float), | intent(out) | :: | X | |||
| real(kind=float), | intent(out) | :: | Y | |||
| logical, | intent(out), | optional | :: | check |
return false if i and j are outside grid definition |
returns X and Y coordinate given i and j position in grid(i,j)
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| integer, | intent(in) | :: | i | |||
| integer, | intent(in) | :: | j | |||
| type(grid_integer), | intent(in) | :: | grid | |||
| real(kind=float), | intent(out) | :: | X | |||
| real(kind=float), | intent(out) | :: | Y | |||
| logical, | intent(out), | optional | :: | check |
return false if i and j are outside grid definition |
read a grid_integer using information stored in ini configuration file
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(IniList), | intent(in) | :: | ini | |||
| type(grid_integer), | intent(out) | :: | grid | |||
| character(len=*), | intent(in) | :: | section |
coordinate conversion of a grid_real
definition of corner points:
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(grid_real), | intent(in) | :: | GridIn | |||
| type(grid_real), | intent(inout) | :: | GridOut | |||
| real(kind=float), | intent(in), | optional | :: | cellsize |
coordinate conversion of a grid_integer
definition of corner points:
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(grid_integer), | intent(in) | :: | GridIn | |||
| type(grid_integer), | intent(inout) | :: | GridOut | |||
| real(kind=float), | intent(in), | optional | :: | cellsize |
Create a new grid_real with cellsize different from input grid
The content of the created grid is filled in with nearest neighbor method
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(grid_real), | intent(in) | :: | grid | |||
| type(grid_real), | intent(out) | :: | resampledGrid | |||
| real(kind=float), | intent(in) | :: | newCellsize |
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(grid_integer), | intent(in) | :: | grid | |||
| type(grid_integer), | intent(inout) | :: | resampledGrid |
Create a new grid_integer with cellsize different from input grid
The content of the created grid is filled in with nearest neighbor method
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(grid_integer), | intent(in) | :: | grid | |||
| type(grid_integer), | intent(out) | :: | resampledGrid | |||
| real(kind=float), | intent(in) | :: | newCellsize |